<div class="col-sm-8 offset-sm-2 col-md-6 offset-md-3">
  <h1><%= t(".sign_up") %></h1>

  <% if SiteSettings.rules.presence %>
    <h2><%= t(".rules") %></h2>
    <div class="alert alert-warning">
      <%= markdownify(SiteSettings.rules) %>
    </div>
    <p>
      <%= t(".rules_agree") %>
    </p>
  <% end %>

  <h2><%= t(".details") %></h2>
  <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |form| %>
    <div class="tabular-form mb-3">
      <%= text_input_row form, :email, autofocus: true, autocomplete: "email" %>
      <%- if SiteSettings.default_signup_role == "contributor" && SiteSettings.autocreate_creator_for_new_users %>
        <%= form.fields_for :creators, resource.creators.first || Creator.new do |f| %>
          <%= text_input_row f, :name, autocomplete: false, help: t(".creators.name.help") %>
          <%= text_input_row f, :slug, autocomplete: "username", help: t(SiteSettings.federation_enabled? ? ".creators.slug.help_fedi" : ".creators.slug.help") %>
        <% end %>
      <%- else %>
        <%= text_input_row form, :username, autocomplete: "username", help: t(".username.help") %>
      <% end %>
      <%= password_input_row form, :password, autocomplete: "new-password", strength_meter: true %>
      <%= password_input_row form, :password_confirmation, autocomplete: "new-password" %>
      <div>
        <%= form.submit translate(".sign_up"), class: "btn btn-primary" %>
        <div class="float-end">
          <%= AltchaWidget() %>
        </div>
      </div>
    </div>
    <%= content_tag :div, t(".approval_help"), class: "alert alert-info" if SiteSettings.approve_signups %>
  <% end %>

  <%= render "devise/shared/links" %>
</div>
